﻿function sys_islogin() {
    //检查服务器是否已登录，没有登录则跳转至登录页。
    $.ajax({
        type: "post",
        url: "/UserMerber/isLogin",
        dataType: "json",
        async: false,
        success: function (res) {
            if (res != 1) {
                RemoveSession();//清空会话信息
                //location.href = "/page/views/user/user/error.html";
                //layui.msg("对不起，您尚未登录或登录超时,请重新登录！", { icon: 1, time: 1000 }, function () {
                //    top.location.href = "/app/login/login.html";
                //});
                alert("对不起，您尚未登录或登录超时,请重新登录！");
                top.location.href = "/app/login/login.html";

            }

        }
    });
}

function RemoveSession() {
    layui.sessionData('cate', {
        key: 'user',
        remove: true
    });
}